package miao.byusi.bkata.logs

/**
 * 日志级别枚举
 */
enum class LogLevel(val level: Int) {
    DEBUG(0),
    INFO(1),
    WARNING(2),
    ERROR(3),
    CRITICAL(4);
    
    companion object {
        fun fromString(level: String): LogLevel {
            return when (level.uppercase()) {
                "DEBUG" -> DEBUG
                "INFO" -> INFO
                "WARNING", "WARN" -> WARNING
                "ERROR" -> ERROR
                "CRITICAL", "FATAL" -> CRITICAL
                else -> INFO
            }
        }
    }
}